<template>
  <div class="hello">
     <el-menu  router="true">
       <el-submenu>
         <template slot="title">
           <i class="el-icon-location"></i>
           <span>系统设置</span>
         </template>
         <el-menu-item  index="/test">test</el-menu-item>
       </el-submenu>
     </el-menu>

    <button @click="handleClick">{{count}}</button>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      flag:true
     // count:0
    }
  },methods:{
     handleClick(){
      // this.$store.commit('increment');

       this.$store.dispatch('increment2') //分发-request:请求
      // this.count = this.$store.state.count;

     }
  },mounted() {
    // this.count = this.$store.state.count;

    var todones=this.$store.getters.doneTodos;
    console.log(todones);

  },computed:{
      count() {
           return this.$store.state.count;
      }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
